#include					"Processor.h"
#include					"NetworkManager.h"

NetworkManager::NetworkManager(Processor & proc) : _tcpClient(proc), _udpServer(proc)
{

}

NetworkManager::~NetworkManager()
{

}

void						NetworkManager::SendToUdp(IOrder* order)
{
	_udpServer.sendToAll(order);
}

void						NetworkManager::SendToTcp(IOrder* order)
{
	_tcpClient.sendOrder(order);
}

void						NetworkManager::ConnectToServer(std::string ip, std::string port)
{
	_tcpClient.connectToHost(ip, port);
}

UdpServer					&NetworkManager::udpServer()
{
	return _udpServer;
}